<h1>
    <?=$this->title; ?>
</h1>
<div id="container" style="margin-top: -50px;">
    <?=Principio_Library_Common::printErrorsAndMsg(); ?>
	<table cellspacing="0" class="table" width="99%">
	    <tr class="row_even">
	        <td width="10%">Type:</td>
	        <td><?=$this->model_type->getType(); ?></td>
	    </tr>
	    <tr class="row_odd">
	        <td>Caption:</td>
		<td><?=$this->model_type->getCaption(); ?></td>
	    </tr>
	    <tr class="row_even">
	        <td>Exts:</td>
		<td><?=$this->model_type->getExts(); ?></td>
	    </tr>
	    <tr class="row_odd">
	        <td>Firmware:</td>
	        <td><?=($this->model_type->getModelFirmware()->getID() == -1 ? "No firmware (upgrade disabled)" : $this->model_type->getModelFirmware()->getCaption()) ?> [Version: <?=($this->model_type->getModelFirmware()->getID() == -1 ? "no version" : $this->model_type->getModelFirmware()->getVersion()) ?>]</td>
	    </tr>
	</table>
    <div class="spa_type_info">
        <br><br>Here you can override templates for this type in this company:<br><br>
<?
        for ($i = 0; $i < $this->model_company_type_ext_template->getExts(); $i++)
        {
?>
        <div class="spa_type_item">
            <div class="subtitle">
                <?=($i == 0) ? "General" : "Ext".$i ?> Template:
            </div>
            <div>
                <textarea id="ext<?=$i; ?>_template"><?=$this->model_company_type_ext_template->getTemplate($i); ?></textarea>
            </div>
        </div>
<?
        };
?>
        <table border="0" width="100%" class="buttons">
            <tr>
                <td align="right">
                    <input class="save" type="submit" name="apply" value="Apply Changes" onClick="ajaxTypes({id: <?=$this->model_type->getID(); ?>, company_id: <?=$this->model_company->getID(); ?>, action: 'short', container: 'inner', exts_count: <?=$this->model_company_type_ext_template->getExts(); ?>, no_refresh: true})"/>
                    <input class="cancel" type="submit" name="reset" value="Reset" onClick="ajaxTypes({id: <?=$this->model_type->getID(); ?>, company_id: <?=$this->model_company->getID(); ?>, action: 'short', container: 'inner', no_apply: true}); return false;"/>
                </td>
            </tr>
        </table>
    </div>
</div>